home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: April 10, 1998
- // Author: Ed Millard
- //
- // Description:
- // This script adds the default folders to a visor panel
- //
- // Input Arguments:
- // visor editor
- //
- // Return Value:
- // None.
- //
-
-
- //
- // visor animation folder commands for filtering clip and pose nodes
- //
-
- global proc string[]
- getLibraryPoses()
- //
- // return list of poses not currently attached to any character
- //
- {
- string $library[];
- string $poses[] = `pose -q -allPoses`;
- int $n = 0;
- int $nposes = size($poses);
- for ($i=0; $i < $nposes; $i++)
- {
- string $characters[] = `clip -q -ch $poses[$i]`;
- if (size($characters) == 0) $library[$n++] = $poses[$i];
- }
- return $library;
- }
-
- global proc string[]
- getLibraryClips()
- //
- // return list of clips not currently attached to any character
- //
- {
- string $library[];
- string $clips[] = `clip -q -allSourceClips`;
- int $n = 0;
- int $nclips = size($clips);
- for ($i=0; $i < $nclips; $i++)
- {
- string $characters[] = `clip -q -ch $clips[$i]`;
- if (size($characters) == 0) $library[$n++] = $clips[$i];
- }
- return $library;
- }
-
- global proc string[]
- getAllCharacterClips()
- //
- // return list of clips attached to any character
- //
- {
- string $library[];
- string $clips[] = `clip -q -allSourceClips`;
- int $n = 0;
- int $nclips = size($clips);
- for ($i=0; $i < $nclips; $i++)
- {
- string $characters[] = `clip -q -ch $clips[$i]`;
- if (size($characters) > 0) $library[$n++] = $clips[$i];
- }
- return $library;
- }
-
- global proc string[]
- getAllCharacterPoses()
- //
- // return list of poses attached to any character
- //
- {
- string $library[];
- string $poses[] = `pose -q -allPoses`;
- int $n = 0;
- int $nposes = size($poses);
- for ($i=0; $i < $nposes; $i++)
- {
- string $characters[] = `clip -q -ch $poses[$i]`;
- if (size($characters) > 0) $library[$n++] = $poses[$i];
- }
- return $library;
- }
-
- global proc string[]
- getCharacterClips()
- //
- // return list of clips attached to current character(s)
- //
- {
- string $allClips[];
- string $characters[] = `currentCharacters`;
- int $n=0;
- int $nchars = size($characters);
-
- if ($nchars == 0) return `getAllCharacterClips`;
-
- for ($i=0; $i < $nchars; $i++)
- {
- string $clips[] = `clip -q -n $characters[$i]`;
- for ($j=0; $j < size($clips); $j++)
- $allClips[$n++] = $clips[$j];
- }
- return $allClips;
- }
-
- global proc string[]
- getCharacterPoses()
- //
- // return list of poses attached to current character(s)
- //
- {
- string $allPoses[];
- string $characters[] = `currentCharacters`;
- int $n=0;
- int $nchars = size($characters);
-
- if ($nchars == 0) return `getAllCharacterPoses`;
-
- for ($i=0; $i < $nchars; $i++)
- {
- string $poses[] = `pose -q -n $characters[$i]`;
- for ($j=0; $j < size($poses); $j++)
- $allPoses[$n++] = $poses[$j];
- }
- return $allPoses;
- }
-
-
-
- global proc
- addVisorFolders(string $visorEd)
- {
- visor -reset $visorEd;
-
- int $isHyperShade;
- if($visorEd == "hyperShadePanel1VisorEd") {
- $isHyperShade = 1;
- }else{
- $isHyperShade = 0;
- }
-
- // Animation Nodes Folder
- //
- visor -addFolder -name "Animation"
- -openDirectories 1
- $visorEd;
- visor -addFolder -name "Character Clips & Poses" -parent "Animation"
- -type command -cmd "currentCharacters"
- $visorEd;
- visor -addFolder -name "Clips" -parent "Animation/Character Clips & Poses"
- -type command -cmd "getCharacterClips"
- $visorEd;
- visor -addFolder -name "Poses" -parent "Animation/Character Clips & Poses"
- -type command -cmd "getCharacterPoses"
- $visorEd;
- if (`about -mac`)
- {
- visor -addFolder -name "Unused Clips & Poses" -parent "Animation"
- -type command -cmd "currentCharacters"
- $visorEd;
- }
- else
- {
- visor -addFolder -name "Unused Clips & Poses" -parent "Animation"
- $visorEd;
- }
- visor -addFolder -name "Clips" -parent "Animation/Unused Clips & Poses"
- -type command -cmd "getLibraryClips"
- $visorEd;
- visor -addFolder -name "Poses" -parent "Animation/Unused Clips & Poses"
- -type command -cmd "getLibraryPoses"
- $visorEd;
-
- // Rendering Nodes Folder
- //
- visor -addFolder -name "Rendering"
- -openDirectories 1 $visorEd;
- visor -addFolder -name "Cameras" -parent "Rendering"
- -type command -cmd "ls -type camera -type imagePlane"
- $visorEd;
- visor -addFolder -name "Lights" -parent "Rendering"
- -type command -cmd "ls -type light"
- $visorEd;
- visor -addFolder -name "Materials" -parent "Rendering"
- -type connectedNodes -openFolder 1 -cmd "ls -type defaultShaderList"
- $visorEd;
- visor -addFolder -name "Post Process" -parent "Rendering"
- -type command -cmd "ls -type opticalFX -type shaderGlow"
- $visorEd;
- visor -addFolder -name "Textures" -parent "Rendering"
- -type connectedNodes -openFolder 1 -cmd "ls -type defaultTextureList"
- $visorEd;
- visor -addFolder -name "Utilities" -parent "Rendering"
- -type connectedNodes -cmd "ls -type defaultRenderUtilityList"
- $visorEd;
-
-
- /*
- // The Scene folder and the User Defined folder are disabled until we
- // decide exactly how they are intended to work. (jdc rendering)
- //
- if (`isTrue MayaCreatorExists` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- // Scene Nodes Folder
- //
- visor -addFolder -name "Scene" $visorEd;
-
- // Scene/Deformers
- //
- visor -addFolder -name "Deformers" -parent "Scene" $visorEd;
- visor -addFolder -name "Blend Shapes" -parent "Scene/Deformers"
- -type command -cmd "ls -type blendShape"
- $visorEd;
- visor -addFolder -name "Clusters" -parent "Scene/Deformers"
- -type command -cmd "ls -type cluster"
- $visorEd;
- visor -addFolder -name "Lattices" -parent "Scene/Deformers"
- -type command -cmd "ls -type lattice"
- $visorEd;
- visor -addFolder -name "Sculpt Objects" -parent "Scene/Deformers"
- -type command -cmd "ls -type sculpt"
- $visorEd;
- visor -addFolder -name "Wires" -parent "Scene/Deformers"
- -type command -cmd "ls -type wire"
- $visorEd;
-
- // Scene/Dynamics
- //
- visor -addFolder -name "Dynamics" -parent "Scene" $visorEd;
- visor -addFolder -name "Emitters" -parent "Scene/Dynamics"
- -type command -cmd "ls -type pointEmitter"
- $visorEd;
- visor -addFolder -name "Particles" -parent "Scene/Dynamics"
- -type command -cmd "ls -type particle"
- $visorEd;
- visor -addFolder -name "Rigid Bodies" -parent "Scene/Dynamics"
- -type command -cmd "ls -type rigidBody"
- $visorEd;
- visor -addFolder -name "Rigid Constraints" -parent "Scene/Dynamics"
- -type command -cmd "ls -type rigidConstraint"
- $visorEd;
-
- // Scene/Geometry
- //
- visor -addFolder -name "Geometry" -parent "Scene" $visorEd;
- visor -addFolder -name "NURBS Curves" -parent "Scene/Geometry"
- -type command -cmd "ls -type nurbsCurve"
- $visorEd;
- visor -addFolder -name "NURBS Surface" -parent "Scene/Geometry"
- -type command -cmd "ls -type nurbsSurface"
- $visorEd;
- visor -addFolder -name "Polys" -parent "Scene/Geometry"
- -type command -cmd "ls -type mesh"
- $visorEd;
- visor -addFolder -name "Transforms" -parent "Scene/Geometry"
- -type command -cmd "ls -type transform"
- $visorEd;
-
- // Scene/IK
- //
- visor -addFolder -name "IK" -parent "Scene" $visorEd;
- visor -addFolder -name "Effectors" -parent "Scene/IK"
- -type command -cmd "ls -type ikEffector"
- $visorEd;
- visor -addFolder -name "Handles" -parent "Scene/IK"
- -type command -cmd "ls -type ikHandle"
- $visorEd;
- visor -addFolder -name "Joints" -parent "Scene/IK"
- -type command -cmd "ls -type joint"
- $visorEd;
-
- // User Defined Folders
- //
- visor -addFolder -name "User Defined" $visorEd;
- }
- */
-
- // Create Nodes Folder
- //
- visor -addFolder -name "Create" -openDirectories 1 $visorEd;
- visor -addFolder -name "Cameras" -parent "Create"
- -type defaultNodes -cmd "cameraCreateFolder()"
- $visorEd;
- visor -addFolder -name "Lights" -parent "Create"
- -type defaultNodes -cmd "listNodeTypes light"
- $visorEd;
- visor -addFolder -name "Materials" -parent "Create"
- -openFolder $isHyperShade
- -type defaultNodes -cmd "listNodeTypes \"shader/surface\""
- $visorEd;
- visor -addFolder -name "Volume" -parent "Create/Materials"
- -type defaultNodes -cmd "listNodeTypes \"shader/volume\""
- $visorEd;
- visor -addFolder -name "Post Process" -parent "Create"
- -type defaultNodes -cmd "postProcessCreateFolder()"
- $visorEd;
- visor -addFolder -name "Textures" -parent "Create"
- -openFolder $isHyperShade
- -type defaultNodes -cmd "listNodeTypes texture"
- $visorEd;
- if (`about -mac`)
- {
- visor -addFolder -name "Utilities" -parent "Create"
- -type defaultNodes -cmd ""$visorEd;
- }
- else
- {
- visor -addFolder -name "Utilities" -parent "Create"$visorEd;
- }
-
- visor -addFolder -name "Color" -parent "Create/Utilities"
- -type defaultNodes -cmd "listNodeTypes \"utility/color\""
- $visorEd;
- visor -addFolder -name "General" -parent "Create/Utilities"
- -type defaultNodes -cmd "listNodeTypes \"utility/general\""
- $visorEd;
- visor -addFolder -name "Particle" -parent "Create/Utilities"
- -type defaultNodes -cmd "listNodeTypes \"utility/particle\""
- $visorEd;
- visor -addFolder -name "Switch" -parent "Create/Utilities"
- -type defaultNodes -cmd "listNodeTypes \"utility/switch\""
- $visorEd;
-
- // Project directory
- //
- visor
- -addFolder
- -openDirectories 1
- -type directoryCommand
- -cmd "currentProjectParentDir()"
- -name "Project"
- $visorEd;
-
- if (`isTrue MayaCreatorExists` && (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- string $runTimeDir = `getenv "MAYA_LOCATION"`;
- if ($runTimeDir != "") {
- string $brushDir = ($runTimeDir + "/brushes");
- visor
- -addFolder
- -name "Brushes"
- -menu "CreatorShelf"
- -type shelfItems
- -cmd $brushDir
- $visorEd;
- }
- }
-
- // Custom disk folders
- //
- // Get from an optionVar the list of directories for which custom disk
- // folders are to be created. Create a folder for each.
- //
- if (`optionVar -exists visorCustomDiskFolders`)
- {
- int $i;
- string $customFolderNameArray[];
-
- $customFolderNameArray = `optionVar -query visorCustomDiskFolders`;
-
- for ($i = 0; $i < size($customFolderNameArray); $i++)
- {
- visor
- -addFolder
- -type directory
- -openFolder true
- -path $customFolderNameArray[$i]
- -name $customFolderNameArray[$i]
- $visorEd;
- }
- }
- }
-
-